//
//  HEIMSystemMessageCell.m
//  HealthElderly
//
//  Created by 吴欧 on 2021/3/1.
//  Copyright © 2021 honglutec. All rights reserved.
//

#import "HEIMSystemMessageCell.h"

@interface HEIMSystemMessageCell ()

@property(nonatomic, strong) UILabel *textLb;

@end

@implementation HEIMSystemMessageCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
    if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        
        self.selectionStyle = UITableViewCellSelectionStyleNone;
  
        [self initUI];
    }
    return self;
}

- (void)initUI {
    _textLb = [UILabel new];
    _textLb.text = @"-";
    _textLb.font = DYFont(16);
    _textLb.numberOfLines = 0;
    _textLb.lineBreakMode = NSLineBreakByCharWrapping;
    [self.contentView addSubview: _textLb];
 
    [_textLb mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self.contentView).mas_offset(10);
        make.left.equalTo(self.contentView).mas_offset(10);
        make.right.equalTo(self.contentView).mas_offset(-10);
        make.bottom.equalTo(self.contentView).mas_offset(-10);
    }];
}

- (void)configCellWithModel:(HEIMMessageModel *)model {
    _textLb.text = model.message.text;
    _textLb.textColor = model.warpTextColor;

//    [_textLb mas_updateConstraints:^(MASConstraintMaker *make) {
//        make.width.mas_offset(model.contentWidth);
//    }];

    // 必须写
//    [self refreshData:model];
}

@end
